>From bounce-amos-list--884-mcox=access.digex.net@onelist.com Wed Sep 2 05:27:35 1998 Received: from onelist.com (pop.onelist.com [209.207.135.253]) by pony-1.mail.digex.net (8.8.8/8.8.8) with SMTP id FAA05917 for ; Wed, 2 Sep 1998 05:27:35 -0400 (EDT) Received: (qmail 31743 invoked by alias); 2 Sep 1998 09:25:08 -0000 Received: (qmail 31736 invoked from network); 2 Sep 1998 09:25:06 -0000 Received: from unknown (HELO neodymium.btinternet.com) (194.73.73.83) by pop.onelist.com with SMTP; 2 Sep 1998 09:25:06 -0000 Received: from np5gt [195.99.56.103] by neodymium.btinternet.com with smtp (Exim 1.70 #1) id 0zE9BF-0002qS-00; Wed, 2 Sep 1998 10:26:21 +0100 Message-ID: <004b01bdd653$ceb46380$673863c3@np5gt> From: "John Glanville" To: Date: Wed, 2 Sep 1998 10:26:44 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Mailing-List: list amos-list@onelist.com; contact http://www.onelist.com Delivered-To: mailing list amos-list@onelist.com Precedence: bulk Reply-to: amos-list@onelist.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0048_01BDD65C.2E814140" Subject: [amos-list] DMA... Its all in the Bitplanes! 4 graphics Ne way Status: O X-Status: From: "John Glanville" This is a multi-part message in MIME format. ------=_NextPart_000_0048_01BDD65C.2E814140 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable DMA Can Be usefull but it also can be slow.... say for instance u wanted = 2 Use a tint effect in a game or something... Okay sure U could Use = point.... read in all the pixels... then change their colour accordingly = 2 the tinted colours in your pallete! Then again you must have a vastly = Excellerated Computer!!!!!!! So Instead U could Use DMA.... If U know = how Screens and Bitplanes work its easy from here..... Screens work by layers of bits... take a 64 colour screen... it has 6 = bitplanes 2 keep under control... this is why the more colours U have when doin graphics the slower things = can be.... All of the first 4 bits, if they all =3D1 then the number = produced from 11110 is 31 meaning colour 31... so if U turn the last bit = 2 a one U are infact adding 32 2 the original 31 coz Binary works like = this 1 2 4 8 16 32 64 128 256 1 1 1 1 1 0 Col=3D1+2+4+8+16 Col=3D31 and what happens if u add 32 to a number lower than 32 in a EHB palette? = Any guesses!!! You change the colour 2 Half Brite.... So if U were 2 make a prog 2 just change the bits at bitplane 5 on a 64 = colour screen you would get darkening effects..... But just wait till u use it with 256 cols on a public screen!! HEY HEY! = Thats fun! Here is a bit of code 2 change the bits on a screen from your = coords..... Don't Let anything go out side the confines of You screen especially on = the Y axis coz what You R seeing is memory on your screen so if You poke past the = set memory 4 Your screen U R likeley to crash!!!! Use a clipping procedure or like i have 4 the mouse. Limit Mouse 128,42 To 320+127,255+41 L0=3DLogbase(0) ;This can change = depends on what U want 2 do! Do=20 MX=3DX Screen(X Mouse) MY=3DY Screen(Y Mouse) PX=3DMX/8 AX=3DMX-(PX*8) Bset(7-AX),L0+(MY*40)+PX ;All ways make = sure that L0 is at a logbase though.. Loop=20 You could also use copy or fill on the screen 2 get large chunks of = Bitplanes changed..... Also if You want shapes just open another screen with 2 colours ( 1 = bitplane ) draw the shape then grab that pitplane and paste it 2 where U want.. or = U could Use a BOB system! ------=_NextPart_000_0048_01BDD65C.2E814140 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
DMA Can Be usefull but it also can = be slow....=20 say for instance u wanted 2 Use a tint effect in a game or something... = Okay=20 sure U could Use point.... read in all the pixels... then change their = colour=20 accordingly 2 the tinted colours in your pallete! Then again you must = have a=20 vastly Excellerated Computer!!!!!!! So Instead U could Use DMA.... If U = know how=20 Screens and Bitplanes work its easy from here.....
 
Screens work by layers of bits... = take a 64=20 colour screen... it has 6 bitplanes 2 keep under control...
this is why the more colours U have = when doin=20 graphics the slower things can be.... All of the first 4 bits, if they = all =3D1=20 then the number produced from 11110 is 31 meaning colour 31... so if U = turn the=20 last bit 2 a one U are infact adding 32 2 the original 31 coz Binary = works like=20 this
 
1 2 4 8 16 32 64 128 = 256
1 1 1 1  1  0
 
Col=3D1+2+4+8+16
Col=3D31
 
and what happens if u add 32 to a = number lower=20 than 32 in a EHB palette? Any guesses!!!
You change the colour 2 Half=20 Brite....
So if U were 2 make a prog 2 just = change the=20 bits at bitplane 5 on a 64 colour screen you would get darkening=20 effects.....
 
But just wait till u use it with 256 = cols on a=20 public screen!! HEY HEY! Thats fun!
Here is a bit of code 2 change the = bits on a=20 screen from your coords.....
Don't Let anything go out side the = confines of=20 You screen especially on the Y axis
coz what You R = seeing is=20 memory on your screen so if You poke past the set memory 4 Your screen U = R=20 likeley to crash!!!!
Use a clipping procedure or like i have 4 the=20 mouse.
Limit Mouse 128,42 To=20 320+127,255+41
L0=3DLogbase(0)      &nbs= p;            = ;            =         =20 ;This can change depends on what
U = want 2=20 do!
Do
   MX=3DX Screen(X Mouse)
   MY=3DY = Screen(Y=20 Mouse)
   PX=3DMX/8
   = AX=3DMX-(PX*8)
  =20 Bset(7-AX),L0+(MY*40)+PX        &= nbsp;           &n= bsp;      =20 ;All ways make sure that L0 is at a logbase though..
Loop =
You could also use copy or fill on = the screen 2=20 get large chunks of Bitplanes changed.....
Also if You want shapes just open = another screen=20 with 2 colours ( 1 bitplane )
draw the shape then grab that = pitplane and paste=20 it 2 where U want.. or U could Use a BOB = system!
------=_NextPart_000_0048_01BDD65C.2E814140--